export const httpMethods = [
  'GET', // 获取资源
  'POST', // 创建资源或提交数据
  'PUT', // 更新整个资源
  'PATCH', // 部分更新资源
  'DELETE', // 删除资源
  'HEAD', // 获取响应头信息
  'OPTIONS', // 查询服务器支持的请求方法
  'CONNECT', // 建立隧道连接 (用于代理)
  'TRACE', // 回显服务器收到的请求 (用于调试)
] as const;

export const httpMethodColors = {
  // 基础方法
  GET: 'sky',      // 天空蓝 - 代表数据获取的清新感 (常用方法)
  POST: 'emerald', // 翡翠绿 - 象征资源创建的生命力
  PUT: 'amber',    // 琥珀橙 - 表示资源更新的能量感
  DELETE: 'rose',  // 玫瑰红 - 警示删除操作的破坏性

  // 调试类方法
  HEAD: 'indigo',  // 靛蓝 - 体现头信息的神秘感
  OPTIONS: 'cyan', // 青蓝 - 代表通信选项的科技感

  // 特殊协议方法
  PATCH: 'lime',   // 青柠绿 - 部分更新的灵活性
  CONNECT: 'gray', // 中性灰 - 隧道连接的中间态
  TRACE: 'violet'  // 紫罗兰 - 调试追踪的可见性
} as const;

export const httpMethodBadges = [
  {
    method: 'GET',
    bgClass: 'bg-sky-500 dark:bg-sky-700',
    textClass: 'text-white dark:text-sky-100',
    hoverClass: 'hover:bg-sky-600 dark:hover:bg-sky-800'
  },
  {
    method: 'POST',
    bgClass: 'bg-emerald-500 dark:bg-emerald-700',
    textClass: 'text-white dark:text-emerald-100',
    hoverClass: 'hover:bg-emerald-600 dark:hover:bg-emerald-800'
  },
  {
    method: 'PUT',
    bgClass: 'bg-amber-400 dark:bg-amber-700',
    textClass: 'text-gray-900 dark:text-amber-100',
    hoverClass: 'hover:bg-amber-500 dark:hover:bg-amber-800'
  },
  {
    method: 'DELETE',
    bgClass: 'bg-rose-500 dark:bg-rose-700',
    textClass: 'text-white dark:text-rose-100',
    hoverClass: 'hover:bg-rose-600 dark:hover:bg-rose-800'
  },
  {
    method: 'PATCH',
    bgClass: 'bg-lime-400 dark:bg-lime-700',
    textClass: 'text-gray-900 dark:text-lime-100',
    hoverClass: 'hover:bg-lime-500 dark:hover:bg-lime-800'
  },
  {
    method: 'HEAD',
    bgClass: 'bg-indigo-500 dark:bg-indigo-700',
    textClass: 'text-white dark:text-indigo-100',
    hoverClass: 'hover:bg-indigo-600 dark:hover:bg-indigo-800'
  },
  {
    method: 'OPTIONS',
    bgClass: 'bg-cyan-500 dark:bg-cyan-700',
    textClass: 'text-white dark:text-cyan-100',
    hoverClass: 'hover:bg-cyan-600 dark:hover:bg-cyan-800'
  },
  {
    method: 'CONNECT',
    bgClass: 'bg-gray-500 dark:bg-gray-700',
    textClass: 'text-white dark:text-gray-100',
    hoverClass: 'hover:bg-gray-600 dark:hover:bg-gray-800'
  },
  {
    method: 'TRACE',
    bgClass: 'bg-purple-500 dark:bg-purple-700',
    textClass: 'text-white dark:text-purple-100',
    hoverClass: 'hover:bg-purple-600 dark:hover:bg-purple-800'
  }
] as const;

export const defaultHeaders = [
  { isDefault: true, valid: true, key: 'Accept', value: '*/*' }, // 接受所有响应类型
  { isDefault: true, valid: true, key: 'User-Agent', value: 'Mozilla/5.0 (兼容所有; 通用客户端)' },
  { isDefault: true, valid: true, key: 'Host', value: 'example.com' }, // 目标域名（自动生成）
  { isDefault: true, valid: true, key: 'Connection', value: 'keep-alive' }, // 保持持久连接
  { isDefault: true, valid: true, key: 'Accept-Encoding', value: 'gzip, deflate, br, zstd' }, // 支持所有压缩算法
  { isDefault: true, valid: true, key: 'Accept-Language', value: '*' }, // 接受所有语言
  { isDefault: true, valid: true, key: 'Content-Type', value: 'application/octet-stream' }, // 通用二进制类型
  { isDefault: true, valid: true, key: 'Authorization', value: 'Basic <credentials>' }, // 基础认证占位符
  { isDefault: true, valid: true, key: 'Origin', value: 'https://your-domain.com' }, // CORS 必带
  { isDefault: true, valid: true, key: 'Access-Control-Request-Method', value: '*' }, // 预检请求方法通配
  { isDefault: true, valid: true, key: 'Access-Control-Request-Headers', value: '*' }, // 预检头通配
  { isDefault: true, valid: true, key: 'Cache-Control', value: 'no-cache' }, // 禁用缓存
  { isDefault: true, valid: true, key: 'Pragma', value: 'no-cache' }, // HTTP/1.0 向后兼容
  { isDefault: true, valid: true, key: 'If-None-Match', value: '*' }, // 条件请求通配
  { isDefault: true, valid: true, key: 'If-Modified-Since', value: '0' }, // 强制检查最新内容
  { isDefault: true, valid: true, key: 'X-Requested-With', value: 'XMLHttpRequest' }, // 标识 AJAX
  { isDefault: true, valid: true, key: 'Sec-Fetch-Dest', value: 'empty' }, // 安全策略：空目标
  { isDefault: true, valid: true, key: 'DNT', value: '1' }, // 禁用追踪
  { isDefault: true, valid: true, key: 'TE', value: 'trailers' }, // 支持 trailer 头
];

export const rawTypes = [
  { rawType: 'json', contentType: 'application/json', selected: true },
  { rawType: 'xml', contentType: 'application/xml' },
  { rawType: 'html', contentType: 'text/html' },
  { rawType: 'plaintext', contentType: 'text/plain' },
  { rawType: 'javascript', contentType: 'application/javascript' },
  { rawType: 'yaml', contentType: 'application/yaml' },
  { rawType: 'csv', contentType: 'text/csv' },
  { rawType: 'graphql', contentType: 'application/json' },
  { rawType: 'markdown', contentType: 'text/markdown' },
  { rawType: 'binary', contentType: 'application/octet-stream' },
  { rawType: 'edn', contentType: 'application/edn' },
  { rawType: 'protobuf', contentType: 'application/x-protobuf' },
  { rawType: 'msgpack', contentType: 'application/x-msgpack' },
  { rawType: 'jwt', contentType: 'application/jwt' },
  // { rawType: "activitystreams", contentType: "application/activity+json" },
  { rawType: 'geojson', contentType: 'application/geo+json' },
  { rawType: 'cbor', contentType: 'application/cbor' },
] as const;


// 创建唯一的上下文键
export const BaseUrlContext = Symbol();


